package com.yunhuakeji.wddx.control;

import java.io.ByteArrayInputStream;
import java.io.InputStream;
import com.yunhuakeji.wddx.impl.IMLogin;
import com.yunhuakeji.wddx.service.LoginService;
import com.yunhuakeji.wddx.utils.ResultUtil;
import com.yunhuakeji.wddx.utils.VerificationCode;

public class LoginController extends ActionTicketSupport
{
	private static final long serialVersionUID = 1L;
	private InputStream inputStream;
	private String password, result, VerificationCode, callback, ticket, petname, username, tel_number, sex, yearofbirth, monthofbirth, dayofbirth, constellation, boold_type, living_provinces, living_municipality, living_district, household_registration_provinc, household_registration_municip, household_registration_distric;
	private String path;

	public String getPath()
	{
		return path;
	}

	public void setPath(String path)
	{
		this.path = path;
	}

	private ByteArrayInputStream imageStream;

	public ByteArrayInputStream getImageStream()
	{
		return imageStream;
	}

	public void setImageStream(ByteArrayInputStream imageStream)
	{
		this.imageStream = imageStream;
	}

	public LoginController() throws Exception
	{
		super();
	}

	public String loginWithPc()
	{
		result = new LoginService().checkLoginWithPc(this.getUserid(), password, VerificationCode);

		return SUCCESS;
	}

	public String loginOut()
	{
		path = new LoginService().loginout(this.getUserid());
		return "redirect";
	}

	public String getSTUDENTDATA()
	{
		inputStream = new ResultUtil().resultString(callback, new IMLogin().getSTUDENTDATA(this.getUserid(), ticket));
		return SUCCESS;
	}

	public String updatestudentdata()
	{
		inputStream = new ResultUtil().resultString(callback, new IMLogin().updatestudentdata(this.getUserid(), this.getTicket(), petname, username, tel_number, sex, yearofbirth, monthofbirth, dayofbirth, constellation, boold_type, living_provinces, living_municipality, living_district, household_registration_provinc, household_registration_municip, household_registration_distric));
		return SUCCESS;
	}

	public String getVerificationCode()
	{
		imageStream = new VerificationCode().getVerificationCode();
		return SUCCESS;
	}

	public InputStream getInputStream()
	{
		return inputStream;
	}

	public void setInputStream(InputStream inputStream)
	{
		this.inputStream = inputStream;
	}

	public String getCallback()
	{
		return callback;
	}

	public void setCallback(String callback)
	{
		this.callback = callback;
	}

	public String getPetname()
	{
		return petname;
	}

	public void setPetname(String petname)
	{
		this.petname = petname;
	}

	public String getUsername()
	{
		return username;
	}

	public void setUsername(String username)
	{
		this.username = username;
	}

	public String getTel_number()
	{
		return tel_number;
	}

	public void setTel_number(String tel_number)
	{
		this.tel_number = tel_number;
	}

	public String getSex()
	{
		return sex;
	}

	public void setSex(String sex)
	{
		this.sex = sex;
	}

	public String getYearofbirth()
	{
		return yearofbirth;
	}

	public void setYearofbirth(String yearofbirth)
	{
		this.yearofbirth = yearofbirth;
	}

	public String getMonthofbirth()
	{
		return monthofbirth;
	}

	public void setMonthofbirth(String monthofbirth)
	{
		this.monthofbirth = monthofbirth;
	}

	public String getDayofbirth()
	{
		return dayofbirth;
	}

	public void setDayofbirth(String dayofbirth)
	{
		this.dayofbirth = dayofbirth;
	}

	public String getConstellation()
	{
		return constellation;
	}

	public void setConstellation(String constellation)
	{
		this.constellation = constellation;
	}

	public String getBoold_type()
	{
		return boold_type;
	}

	public void setBoold_type(String boold_type)
	{
		this.boold_type = boold_type;
	}

	public String getLiving_provinces()
	{
		return living_provinces;
	}

	public void setLiving_provinces(String living_provinces)
	{
		this.living_provinces = living_provinces;
	}

	public String getLiving_municipality()
	{
		return living_municipality;
	}

	public void setLiving_municipality(String living_municipality)
	{
		this.living_municipality = living_municipality;
	}

	public String getLiving_district()
	{
		return living_district;
	}

	public void setLiving_district(String living_district)
	{
		this.living_district = living_district;
	}

	public String getHousehold_registration_provinc()
	{
		return household_registration_provinc;
	}

	public void setHousehold_registration_provinc(String household_registration_provinc)
	{
		this.household_registration_provinc = household_registration_provinc;
	}

	public String getHousehold_registration_municip()
	{
		return household_registration_municip;
	}

	public void setHousehold_registration_municip(String household_registration_municip)
	{
		this.household_registration_municip = household_registration_municip;
	}

	public String getHousehold_registration_distric()
	{
		return household_registration_distric;
	}

	public void setHousehold_registration_distric(String household_registration_distric)
	{
		this.household_registration_distric = household_registration_distric;
	}

	public String getPassword()
	{
		return password;
	}

	public void setPassword(String password)
	{
		this.password = password;
	}

	public void setVerificationCode(String verificationCode)
	{
		VerificationCode = verificationCode;
	}

	public String getResult()
	{
		return result;
	}

	public void setResult(String result)
	{
		this.result = result;
	}

	public String getTicket()
	{
		return ticket;
	}

	public void setTicket(String ticket)
	{
		this.ticket = ticket;
	}

}
